<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div class="table-box tablenes">
            <div class="title">基本信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">项目名称</td><td class="tv" id="name"></td><td class="tt">项目编号</td><td class="tv" id="number"></td></tr>
                <tr><td class="tt">项目类型</td><td class="tv" id="engintype"></td><td class="tt">合同金额(元)</td><td class="tv" id="hemoney"></td></tr>
                <tr><td class="tt">项目地点</td><td class="tv" id="areas"></td><td class="tt">详细地址</td><td class="tv" id="addr"></td></tr>
                <tr><td class="tt">项目状态</td><td class="tv" id="state_name" colspan="3"></td></tr>
                <tr><td class="tt">合同计划开工日期</td><td class="tv" id="planstartdt"></td><td class="tt">合同计划竣工日期</td><td class="tv" id="planenddt"></td></tr>
                <tr><td class="tt">实际开工日期</td><td class="tv" id="startdt"></td><td class="tt">实际竣工日期</td><td class="tv" id="enddt"></td></tr>
                <tr><td class="tt">项目概况</td><td class="tv" id="gai" colspan="3"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>
        <div class="table-box tablenes">
            <div class="title">参建单位</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">建设单位</td><td class="tv" id="jian_unit_name" colspan="3"></td></tr>
                <tr><td class="tt">设计单位</td><td class="tv" id="she_unit_name" colspan="3"></td></tr>
                <tr><td class="tt">勘查单位</td><td class="tv" id="kan_unit_name" colspan="3"></td></tr>
                <tr><td class="tt">施工单位</td><td class="tv" id="shi_unit_name" colspan="3"></td></tr>
                <tr><td class="tt">监理单位</td><td class="tv" id="li_unit_name" colspan="3"></td></tr>
                <tr><td class="tt">运营单位</td><td class="tv" id="yun_unit_name" colspan="3"></td></tr>
                <tr><td class="tt">供应商单位</td><td class="tv" id="gong_unit_name" colspan="3"></td></tr>
                <tr><td class="tt">制造商单位</td><td class="tv" id="zhi_unit_name" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_engin_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;

                $("#name").text(data.name);
                $("#number").text(data.number);
                $("#engintype").text(data.engintype);
                $("#areas").text(data.areas);
                $("#addr").text(data.addr);
                $("#hemoney").text(data.hemoney);
                $("#state_name").text(data.state_name);
                $("#jian_unit").text(data.jian_unit);
                $("#planstartdt").text(data.planstartdt);
                $("#planenddt").text(data.planenddt);
                $("#startdt").text(data.startdt);
                $("#enddt").text(data.enddt);
                $("#gai").text(data.gai);
                $("#explain").text(data.explain);


                show_gezhong_dealcom('jian_unit_name', data.jian_unit_arr);
                show_gezhong_dealcom('she_unit_name', data.she_unit_arr);
                show_gezhong_dealcom('kan_unit_name', data.kan_unit_arr);
                show_gezhong_dealcom('shi_unit_name', data.shi_unit_arr);
                show_gezhong_dealcom('li_unit_name', data.li_unit_arr);
                show_gezhong_dealcom('yun_unit_name', data.yun_unit_arr);
                show_gezhong_dealcom('gong_unit_name', data.gong_unit_arr);
                show_gezhong_dealcom('zhi_unit_name', data.zhi_unit_arr);









                // $(".pageshowtitle").text('项目信息');

                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('engin', param_id);
        showpage_dropopt();
    });



    function show_gezhong_dealcom(dom, data) {
        var str = '';
        for (var key in data){
            if(str){
                str += '，<span class="colorlan" onclick="openPage(\'../dealcom/show.php?id='+data[key].id+'\')">'+data[key].name+'</span>';
            }else{
                str += '<span class="colorlan" onclick="openPage(\'../dealcom/show.php?id='+data[key].id+'\')">'+data[key].name+'</span>';
            }

        }
        $("#"+dom).html(str);
    }



</script>
</body>
</html>




